package at.fhooe.mc.master.clc.server.domain;

import at.fhooe.mc.master.clc.server.domain.datastorenative.BigEntityDatastoreNative;
import at.fhooe.mc.master.clc.server.domain.datastorenative.SmallEntityDatastoreNative;
import at.fhooe.mc.master.clc.server.domain.jdo.BigEntityJdo;
import at.fhooe.mc.master.clc.server.domain.jdo.SmallEntityJdo;
import at.fhooe.mc.master.clc.server.domain.jpa.BigEntityJpa;
import at.fhooe.mc.master.clc.server.domain.jpa.SmallEntityJpa;
import at.fhooe.mc.master.clc.server.domain.objectify.BigEntityObjectify;
import at.fhooe.mc.master.clc.server.domain.objectify.SmallEntityObjectify;
import at.fhooe.mc.master.clc.shared.domain.FrameworkID;
import at.fhooe.mc.master.clc.shared.domain.metrics.MetricKey;

public class FrameworkTestClassMapping
{
	public static TestableWrapper getTestClassForFrameworkIdAndMetric(
			FrameworkID id, MetricKey key)
	{
		switch (key)
			{
			case BIG_CHUNK_DELETE:
			case BIG_CHUNK_LOAD:
			case BIG_CHUNK_LOAD_FILTER_LIST:
			case BIG_CHUNK_SAVE: 
			case BIG_CHUNK_UPDATE:
				switch (id)
					{
					case JDO:
						return new TestableWrapper(BigEntityJdo.class, 1, 1);
					case JPA:
						return  new TestableWrapper(BigEntityJpa.class, 1, 1);
					case NATIVE:
						return  new TestableWrapper(BigEntityDatastoreNative.class, 1, 1);
					case OBJECTIFY:
						return new TestableWrapper(BigEntityObjectify.class, 1, 1);
					default:
						break;
					}
				break;
			case SMALL_CHUNK_DELETE:
			case SMALL_CHUNK_LOAD:
			case SMALL_CHUNK_SAVE:
			case SMALL_CHUNK_UPDATE:
				switch (id)
				{
				case JDO:
					return new TestableWrapper(SmallEntityJdo.class, 1, 2);
				case JPA:
					return new TestableWrapper(SmallEntityJpa.class, 1, 2);
				case NATIVE:
					return new TestableWrapper(SmallEntityDatastoreNative.class, 1, 2);
				case OBJECTIFY:
					return new TestableWrapper(SmallEntityObjectify.class, 1, 2);
				default:
					break;
				}
				break;
			case SMALL_CHUNK_LOAD_FILTERED:
			case SMALL_CHUNK_LOAD_ALL:
			case SMALL_CHUNK_SAVE_10:
			case SMALL_CHUNK_DELETE_ALL:
				switch (id)
				{
				case JDO:
					return new TestableWrapper(SmallEntityJdo.class, 10, 3);
				case JPA:
					return new TestableWrapper(SmallEntityJpa.class, 10, 3);
				case NATIVE:
					return new TestableWrapper(SmallEntityDatastoreNative.class, 10, 3);
				case OBJECTIFY:
					return new TestableWrapper(SmallEntityObjectify.class, 10, 3);
				default:
					break;
				}
				break;
			default:
				return null;
			}
		
		return null;
	}
	
	
}
